﻿/*
 * RegExpress
 * 
 * Copyright (c) 2010, Daniel McGaughran
 * 
 * Licensed under the Apache Licence, Version 2.0 (the "Licence");
 * you may not use this file except in compliance with the Licence.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 * 
 */


using System;
using System.Text.RegularExpressions;


namespace RegExpressModel.Entities
{
	/// <summary>
	/// Encapulates the input and result of a MultiMatch control. 
	/// This is designed for processing a single match in the greater context of comparing
	/// different input strings against the same regular expression.
	/// </summary>
	public class SingleMatchCase
	{
		private string _input;
        

		public SingleMatchCase()
		{
			MatchResult = Match.Empty;
		}

		public SingleMatchCase(string input)
		{
			MatchResult = Match.Empty;
			Input = input;
		}



		public string Input
		{
			get { return _input; }
			set
			{
				_input = value;
				Reset();
			}
		}


		public MatchResultType ResultStatus { get; internal set; }
		public Match MatchResult { get; internal set; }
		public int Index { get; internal set; }



		public void Reset()
		{
			ResultStatus = MatchResultType.Unknown;
			MatchResult = Match.Empty;
		}

	
	}
}